﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace RealNumbersValidator
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] validNumbers = { "0", "33", "-2381.78132", "4.3347", "12.00", "0.34"};
            string[] notValidNumbers = { "+3", "24 543", "01.23", "12.", "11,23", "--2", ".25", "-.25", "12е7" };
            string pattern = @"\A(0|(-?[1-9]\d*)|(-?(0|[1-9]\d*)\.\d+))\Z";

            Regex regex = new Regex(pattern);

            Console.WriteLine("Valid:");
            int validBr = 0;
            foreach (string number in validNumbers)
            {
                if (regex.IsMatch(number, 0))
                {
                    Console.WriteLine(number);
                    validBr++;
                }
            }

            Console.WriteLine("Not Valid:");
            int notValidBr = 0;
            foreach(string number in notValidNumbers)
            {
                if (regex.IsMatch(number, 0))
                {
                    Console.WriteLine(number);
                    notValidBr++;
                }
            }

            if (validBr == validNumbers.Length && notValidBr == 0)
            {
                Console.WriteLine("-----\nOK");
            }
        }
    }
}
